<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <meta th:include="common/commons :: layui"/>
    <title>相机权限</title>
    <style type="text/css">
        .layui-form-pane .layui-form-label {
            width: 200px;
        }

        .layui-form-pane .layui-input-block {
            margin-left: 200px;
        }

        .layui-table-fixed-r td {
            height: 68px !important;
        }

        .layui-table-fixed-r th {
            height: 68px !important;
        }

        .layui-table img {
            max-width: 68px;
            min-height: 68px;
        }

        .laytable-cell-3-wx_headimg, .laytable-cell-1-wx_headimg, .laytable-cell-2-wx_headimg, .laytable-cell-3-wx_headimg, .laytable-cell-4-wx_headimg, .laytable-cell-5-wx_headimg, .laytable-cell-6-wx_headimg, .laytable-cell-7-wx_headimg, .laytable-cell-8-wx_headimg, .laytable-cell-9-wx_headimg, .laytable-cell-10-wx_headimg, .laytable-cell-11-wx_headimg, .laytable-cell-12-wx_headimg, .laytable-cell-13-wx_headimg, .laytable-cell-14-wx_headimg {
            width: 68px !important;
            padding: 0 !important;
            height: 68px !important;
            line-height: 68px !important;
        }
    </style>
</head>
<body style="text-align:center">
<div class="layui-row">
    <table id="bindWxTable" lay-filter="bindWxFilter"></table>
</div>

<script type="text/javascript" th:inline="javascript">

    let openId;
    $(function () {
        openId = [[${openId}]];
    });

    layui.use('table', function () {
        var table = layui.table;
        table1 = table.render({
            elem: '#bindWxTable',
            method: 'post',
            contentType: "application/json",
            url: ctx + "/publicUser/getUserPermission?openId=" + openId,
            title: '相机权限列表',
            page: false,
            height: 'full-120',
            cols: [
                [
                    {field: 'communityName', align: 'center', title: '小区名称', width: '200'},
                    {field: 'ip', align: 'center', width: '150', title: '相机局域网ip'},
                    {field: 'door', align: 'center', width: '130', title: '相机所在的门'},
                    {
                        field: 'userPermission',
                        align: 'center',
                        width: '80',
                        title: '权限',
                        templet: function (d) {
                            if (d.userPermission == "success") {
                                return '<span style="color: rgb(154,236,22);">' + '允许' + '</span>'
                            } else if (d.userPermission == "fail") {
                                return '<span style="color: rgb(204,0,0);">' + '不允许' + '</span>'
                            } else {
                                return '<span style="color: rgb(231,215,141);">' + '未知' + '</span>'
                            }

                        }
                    },
                    {field: 'startTime', align: 'center', width: '180', title: '开始时间'},
                    {field: 'endTime', align: 'center', width: '180', title: '结束时间'}
                ]
            ]
        });
    });

</script>
</body>
</html>